﻿<UserControl x:Class="ContactTracing.CaseView.Controls.CaseLinkActionsRowControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:own="clr-namespace:ContactTracing.CaseView"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="bvc"/>

            <Style TargetType="{x:Type Path}">
                <Setter Property="Fill" Value="{StaticResource TabUnderlineSelectedBrush}" />
                <Setter Property="Margin" Value="2, 0, 2, 0" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="Stroke" Value="Transparent" />
                <Setter Property="Stretch" Value="Fill" />
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding
                            RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type DataGridCell}},
                                Path=IsSelected}"
                        Value="True">
                        <Setter Property="Fill" Value="White"/>
                    </DataTrigger>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Fill" Value="#C8C8CA" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <!--<ColumnDefinition Width="19" />-->
        </Grid.ColumnDefinitions>

        <Button x:Name="btnLink" Width="22" Grid.Column="0" Padding="0" Margin="0"
                BorderThickness="0"
                BorderBrush="Transparent" Background="Transparent" Click="btnLink_Click">
            <Path x:Name="pathLink"
              Width="16" 
              Height="16" Data="F1 M 23.4963,46.1288L 25.0796,48.8712L 29.4053,50.0303L 33.519,47.6553L 34.8902,46.8636L 37.6326,45.2803L 38.4242,46.6515L 37.2652,50.9772L 30.4091,54.9356L 21.7577,52.6174L 18.591,47.1326L 20.9091,38.4811L 27.7652,34.5227L 32.0909,35.6818L 32.8826,37.053L 30.1402,38.6364L 28.769,39.428L 24.6553,41.803L 23.4963,46.1288 Z M 38.7348,28.1895L 45.5908,24.2311L 54.2423,26.5493L 57.409,32.0341L 55.0908,40.6856L 48.2348,44.6439L 43.9091,43.4848L 43.1174,42.1136L 45.8598,40.5303L 47.231,39.7386L 51.3446,37.3636L 52.5037,33.0379L 50.9204,30.2955L 46.5946,29.1364L 42.481,31.5114L 41.1098,32.3031L 38.3674,33.8864L 37.5757,32.5152L 38.7348,28.1895 Z M 33.9006,45.1496L 31.7377,44.5701L 30.5502,42.5133L 31.1298,40.3504L 42.0994,34.0171L 44.2623,34.5966L 45.4498,36.6534L 44.8702,38.8163L 33.9006,45.1496 Z ">
                <Path.ToolTip>
                    <StackPanel>
                        <Label FontWeight="Bold" Content="{x:Static p:Resources.EditLink}" />
                        <TextBlock 
                            Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200"
                            Text="{x:Static p:Resources.TooltipEditLink}" />
                    </StackPanel>
                </Path.ToolTip>
            </Path>
            <Button.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="{x:Static p:Resources.EditLink}" Click="mnuEditLink_Click"></MenuItem>
                    <MenuItem Header="{x:Static p:Resources.UnlinkSourceCase}" Click="mnuUnlink_Click"></MenuItem>
                </ContextMenu>
            </Button.ContextMenu>
        </Button>

        <!--<Button x:Name="btnConvert" Grid.Column="1" Width="20" Padding="0" Margin="0" BorderBrush="Transparent" Background="Transparent" Click="btnConvert_Click">
            <Path x:Name="pathConvert"
              Width="14" 
              Height="16" Data="F1 M 21,23L 21,53L 26,53L 26,57L 17,57L 17,19L 26,19L 26,23L 21,23 Z M 27,47L 31,47L 31,53L 55,53L 55,35L 43,35L 43,23L 31,23L 31,41L 27,41L 27,19L 47.25,19L 59,30.75L 59,57L 27,57L 27,47 Z M 22,42L 40,42L 33,36L 39,36L 48.2918,44.3334L 39,52L 33,52L 40,46L 22,46L 22,42 Z M 47,24.25L 47,31L 53.75,31L 47,24.25 Z ">
                <Path.ToolTip>
                    <StackPanel>
                        <Label FontWeight="Bold">Convert to Contact</Label>
                        <TextBlock 
                                               Padding="10" Background="Transparent" TextWrapping="WrapWithOverflow" Width="200">
                                        Converts this case to a contact.</TextBlock>
                    </StackPanel>
                </Path.ToolTip>
            </Path>
        </Button>-->

    </Grid>
</UserControl>
